﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace WEALTH
{
    public partial class IndexImageShow : System.Web.UI.Page
    {
        ExcuteDao dao = new ExcuteDao();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.Request.QueryString["Image_ID"]))
            {

                DataTable dt = dao.GET_IndexImage(Convert.ToInt32(this.Request.QueryString["Image_ID"]));
                if (dt != null && dt.Rows.Count > 0)
                {
                    try
                    {

                        Response.ContentType = dt.Rows[0]["Image_ContentType"].ToString(); //读取文件类型

                        Response.OutputStream.Write(((byte[])dt.Rows[0]["Image_Text"]), 0, ((byte[])dt.Rows[0]["Image_Text"]).Length);

                        Response.End();
                    }
                    catch (Exception ex)
                    {
                        string strMsg = ex.Message.ToString();
                        AppFunction.SaveExceptionLog(ex);
                    }
                }
            }
        }
    }
}